using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Proximity
{
    /// <summary>
    /// <para>Point Distance</para>
    /// <para>Determines the distances from input point features to all points in the near features within a specified search radius.</para>
    /// <para>确定从输入点要素到指定搜索半径内附近要素中所有点的距离。</para>
    /// </summary>    
    [DisplayName("Point Distance")]
    public class PointDistance : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PointDistance()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The point features from which distances to the near features will be calculated.</para>
        /// <para>将计算到近要素距离的点要素。</para>
        /// </param>
        /// <param name="_near_features">
        /// <para>Near Features</para>
        /// <para>The points to which distances from the input features will be calculated. Distances between points within the same feature class or layer can be determined by specifying the same feature class or layer for the input and near features.</para>
        /// <para>将计算与输入要素的距离的点。通过为输入要素和近要素指定相同的要素类或图层，可以确定同一要素类或图层内点之间的距离。</para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output Table</para>
        /// <para>The table containing the list of input features and information about all near features within the search radius. If a search radius is not specified, distances from all input features to all near features are calculated.</para>
        /// <para>包含输入要素列表的表以及有关搜索半径内所有邻近要素的信息。如果未指定搜索半径，则计算从所有输入要素到所有邻近要素的距离。</para>
        /// </param>
        public PointDistance(object _in_features, object _near_features, object _out_table)
        {
            this._in_features = _in_features;
            this._near_features = _near_features;
            this._out_table = _out_table;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Point Distance";

        public override string CallName => "analysis.PointDistance";

        public override List<string> AcceptEnvironments => ["extent", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _near_features, _out_table, _search_radius];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The point features from which distances to the near features will be calculated.</para>
        /// <para>将计算到近要素距离的点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Near Features</para>
        /// <para>The points to which distances from the input features will be calculated. Distances between points within the same feature class or layer can be determined by specifying the same feature class or layer for the input and near features.</para>
        /// <para>将计算与输入要素的距离的点。通过为输入要素和近要素指定相同的要素类或图层，可以确定同一要素类或图层内点之间的距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Near Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _near_features { get; set; }


        /// <summary>
        /// <para>Output Table</para>
        /// <para>The table containing the list of input features and information about all near features within the search radius. If a search radius is not specified, distances from all input features to all near features are calculated.</para>
        /// <para>包含输入要素列表的表以及有关搜索半径内所有邻近要素的信息。如果未指定搜索半径，则计算从所有输入要素到所有邻近要素的距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Search Radius</para>
        /// <para>Specifies the radius used to search for candidate near features. The near features within this radius are considered for calculating the nearest feature. If no value is specified (that is, the default (empty) radius is used) all near features are considered for calculation. The unit of search radius defaults to units of the input features. The units can be changed to any other unit. However, this has no impact on the units of the output DISTANCE field which is based on the units of the coordinate system of the input features.</para>
        /// <para>指定用于搜索候选近要素的半径。在计算最近要素时，将考虑此半径内的近处要素。如果未指定值（即使用默认（空）半径），则将考虑所有邻近要素进行计算。搜索半径的单位默认为输入要素的单位。这些单位可以更改为任何其他单位。但是，这对基于输入要素坐标系单位的输出 DISTANCE 字段的单位没有影响。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_radius { get; set; } = null;


        public PointDistance SetEnv(object extent = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}